package com.yaoyong.yy_demo.module.spring5.aop;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 注解式和方法规则式 配置切面
 * 需要导包:spring-boot-starter-aop
 * @author 86188
 */
public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AopConfig.class);
        DemoAnnotationService annotationService = context.getBean(DemoAnnotationService.class);
        DemoMethodService methodService = context.getBean(DemoMethodService.class);
        annotationService.add();
        methodService.add();
        context.close();
    }
}
